package com.zjitc.controller;

import com.zjitc.pojo.User;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

/**
 * @Author: xml
 * @Date: 2018/10/24 16:32
 * @Version 1.0
 */

public class BaseController {
    protected User getSessionUser(HttpSession session) {
        User user = (User)session.getAttribute("user");
        return user;
    }

    protected void setSessionUser(HttpSession session, User user) {
        session.setAttribute("user", user);
    }
    protected void removeSessionUser(HttpServletRequest request){
        request.getSession().removeAttribute("user");
    }


}